package com.github.wxiaoqi.security.biz.modules.merchant.api;

import java.util.Map;

import javax.validation.Valid;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.github.wxiaoqi.security.biz.common.biz.request.PosLoginReq;
import com.github.wxiaoqi.security.biz.modules.merchant.biz.AppUserTokenBiz;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * app商户登陆
 * @author Administrator
 *
 */
@Api(tags="app商户登陆")
@Controller
@RequestMapping("posApi")
public class PosLoginController {
	
	Logger logger = LoggerFactory.getLogger(PosLoginController.class);
	
	@Autowired
	private AppUserTokenBiz appUserToken;
	
	@ApiOperation("pos登录")
	@RequestMapping(value="/login", method=RequestMethod.POST)
	@ResponseBody
	public Map<String, Object> posLogin(@RequestBody @Valid PosLoginReq params) throws Exception {
		logger.info("pos登录开始。。。。。{}",params);
		Map<String, Object> response = appUserToken.login(params);
		return response;
	}
	
	
}
